package workspace;

import java.util.ArrayList;
//通过28%的测试用例

public class 最小的k个数 {
    public ArrayList<Integer> GetLeastNumbers_Solution(int[] input, int k) {
        int tmp = 0;
        ArrayList<Integer> list = new ArrayList<Integer>(k);
        for (int i = 0; i < k; i++) {
            for (int j = i + 1; j < input.length; j++) {
                if (input[i] > input[j]) {
                    tmp = input[i];
                    input[i] = input[j];
                    input[j] = tmp;
                }
            }
            list.add(input[i]);
        }
        return list;
    }

    public static void main(String[] args) {
        String str2 = "hello";
        String str1 = new String("hello").intern();

        System.out.println(str1 == str2); // true

    }
}

